Skip to content

Added support for suffix on database and/or collection#159

Open
nanny07 wants to merge 1 commit into
loresoft:masterfrom
nanny07:features/suffix
Open

Added support for suffix on database and/or collection#159
nanny07 wants to merge 1 commit into
loresoft:masterfrom
nanny07:features/suffix

Conversation

@nanny07

@nanny07 nanny07 commented Jun 26, 2025

Copy link
Copy Markdown

Summary

This PR introduces the ability to add dynamic suffixes to MongoDB database name and/or collection names in the NLog.Mongo target, enabling more flexible log organization and partitioning strategies (ex. multi tenants)

Changes Made

  • Added databaseSuffixProperty and collectionSuffixProperty to MongoTarget to identify which bson property needs to be read to get the suffix.
  • Updated the collection and database's resolution based on the properties above
  • Updated tests to validate suffix functionality and to show how to configure the property

Fully backward compatible

@github-actions

Copy link
Copy Markdown
Contributor

⏰ Stale Pull Request

No activity for 1 year. Will close in 45 days unless updated.
To keep open, push commits, comment, or remove the stale label.

@github-actions github-actions Bot added the stale label Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant